package encrypt

import (
	"crypto/md5"
	"fmt"
	"math/big"
)

// MD5Sum Calculate using MD5 method
func MD5Sum(value string) string {
	md5Sum := md5.Sum([]byte(value))
	return fmt.Sprintf("%x", md5Sum)
}

// MD5SumUint64 md5后转整型
func MD5SumUint64(src string) uint64 {
	bi := big.NewInt(0)
	h := md5.New()
	h.Write([]byte(src))
	bi.SetBytes(h.Sum(nil))
	return bi.Uint64()
}
